package com.wgtp.ssapp.model.adapters;

import java.util.ArrayList;
import java.util.List;

import com.wgtp.ssapp.R;
import com.wgtp.ssapp.model.Forum;
import com.wgtp.ssapp.model.SubForum;
import com.wgtp.ssapp.model.fragments.MainPageFragment;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.TextView;


public class TabsFragmentAdapter extends FragmentPagerAdapter {

	private ArrayList<Forum> forumList;
	private ArrayList<ArrayList<SubForum>> subForumList;
	private List<Fragment> pages;
    private int count = 0;

    public TabsFragmentAdapter(FragmentManager fm, ArrayList<Forum> forumList, ArrayList<ArrayList<SubForum>> subForumList) {
        super(fm);
        this.forumList = forumList;
        this.subForumList = subForumList;
        this.count = forumList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return forumList.get(position).getName();
    }
    
    @Override
    public Fragment getItem(int position) {
        return new MainPageFragment(subForumList.get(position));
    }

    @Override
    public int getCount() {
        return count;
    }
	
}
